import request from '@/utils/request'

export function getList(data) {
  return request({
    url: "/api/v1/business/patrolStation/findPage",
    method: "get",
    params: data,
  });
}

export function findDevid(data) {
  return request({
    url: "/api/v1/business/patrolStation/findDevid",
    method: "get",
    params: data,
  });
}
export function findLast(data) {
  return request({
    url: "/api/v1/business/patrolStation/findLast?xdId=" + data,
    method: "get",
    params: data,
  });
}
export function areaUpate(data) {
  return request({
    url: "/api/v1/business/patrolStation/getAreaUpate",
    method: "post",
    params: data,
  });
}

export function getListName(data) {
  return request({
    url: "/api/v1/business/patrolStation/dpPsread",
    method: "get",
    params: data,
  });
}

export function getOne(data) {
  return request({
    url: "/api/v1/business/patrolStation/getOne",
    method: "get",
    params: data,
  });
}

export function getFile(data) {
  return request({
    url: "/api/v1/business/patrolStation/getFile?id=" + data,
    method: "get",
    params: data,
  });
}

export function doInsert(data) {
  return request({
    url: "/api/v1/business/patrolStation/insert",
    method: "post",
    data,
  });
}

export function doUpdate(data) {
  return request({
    url: "/api/v1/business/patrolStation/update",
    method: "post",
    data,
  });
}

export function doDelete(data) {
  return request({
    url: "/api/v1/business/patrolStation/del",
    method: "post",
    params: data,
  });
}

export function doDeleteAll(data) {
  return request({
    url: "/api/v1/business/patrolStation/delAll",
    method: "post",
    params: data,
  });
}


/**
 * 导入Excel
 * @returns file
 */
export function doImportExcel(data) {
  return request({
    url: "/api/v1/business/patrolStation/importExcel",
    method: "post",
    // 最长超时时间 3 分钟
    timeout: 180000,
    headers: {
      "Content-Type": "multipart/form-data",
    },
    data,
  });
}
